/* 检查是否为空 */
export const getStoreData = (key: string, data: any) => {
    const storedData = sessionStorage.getItem(key);
    // console.log(key)
    // console.log(storedData)
    if (storedData) {
        return JSON.parse(storedData)
    } else {
        return data
    }
}

export const returnArray = (key: any) => {
    if (key) {
        return JSON.parse(key)
    } else {
        return []
    }
}

/* 检查是否为undefined */
export const checkUndefined = (key: any, item: any) => {
    if (key && key.length == 0) {
        return key
    } else {
        return item
    }
}